<template>
    <el-container style="height: 100%;">
        <el-aside width="200px"  style="">
            <el-menu :default-openeds="[]">
            <el-submenu index="1">
                <template slot="title"><i class="el-icon-thumb"></i>系统管理员</template>
                <el-menu-item index="3-3" @click="adminuser">管理员列表</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
                <template slot="title"><i class="el-icon-user"></i>用户管理</template>
                <el-menu-item index="3-3" @click="user">用户列表</el-menu-item>
            </el-submenu>
            <el-submenu index="3">
                <template slot="title"><i class="el-icon-share"></i>分类管理</template>
                <el-menu-item index="3-3" @click="cate">分类列表</el-menu-item>
            </el-submenu>
             <el-submenu index="4">
                <template slot="title"><i class="el-icon-reading"></i>图书管理</template>
                <el-menu-item index="3-3" @click="books">图书列表</el-menu-item>
            </el-submenu>
             <el-submenu index="5">
                <template slot="title"><i class="el-icon-chat-dot-round"></i>留言管理</template>
                <el-menu-item index="3-3" @click="comment">留言列表</el-menu-item>
            </el-submenu>
            </el-menu>
        </el-aside>
        
        <el-container>
            <el-header style="text-align: right; font-size: 12px">
                <el-button type="info" style="left:101px;" plain @click="logout">退出</el-button>
               <span>{{name}}</span>
            </el-header>
            
                <el-main>
                  <router-view></router-view>
                </el-main>
        </el-container>
        </el-container>
</template>
<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
</style>

<script>
  export default {
    data() {
        return{
          name:''
        }
    },
  mounted() {
   let name = this.$route.query.name;
    this.name = name
    },
    methods:{
      logout(){
        window.sessionStorage.clear()
         this.$router.push('/adminlogin')
      },
      books(){
           this.$router.push('/admin/books')
      },
      user(){
           this.$router.push('/admin/user')
      },
      adminuser(){
          this.$router.push('/admin/adminuser')
      },
      cate(){
          this.$router.push('/admin/cate')
      },
      comment(){
         this.$router.push('/admin/comment')
      }
    }
  };
</script>